* Centroids_proc.do
* 2014.10.25
* Last update 2014.10.25: script created
* Preps files that map CBSA and NECTA codes to lat and long of centroids

capture log close
set more off
timer clear 1
timer on 1
clear
set matsize 10000

local work "/DIRECTORY"

log using "`work'/logs/Centroids_proc.log", replace

* CBSAs
insheet using "`work'/data/gis/CBSAcentroids.csv", comma names clear
rename cbsafp cbsa
keep cbsa latitude longitude
tostring cbsa, replace
gen len=length(cbsa)
tab len
save "`work'/data/gis/CBSAcentroids.dta", replace

* NECTAs
insheet using "`work'/data/gis/NECTAcentroids.csv", comma names clear
rename nectafp cbsa
keep cbsa latitude longitude
tostring cbsa, replace
gen len=length(cbsa)
tab len
save "`work'/data/gis/NECTAcentroids.dta", replace

timer off 1
timer list 1
capture log close



